#ifndef CHATTABBEDWIDGET_H
#define CHATTABBEDWIDGET_H

#include <QWidget>
#include <QDebug>

#include "chatwidget.h"
#include "icybuddy.h"

namespace Ui {
    class ChatTabbedWidget;
}

class ChatTabbedWidget : public QWidget {
    Q_OBJECT

    public:
        ChatTabbedWidget(QWidget *parent = 0, IcyBuddies *fBuddies = 0,
                         IcySettings *fSettings = 0);
        ~ChatTabbedWidget();

        _fastcall void addWidget(const QString &sSN, const QString &sAlias);
        qint8 count() { return tabsCount; }

    protected:
        void changeEvent(QEvent *e);

    private:
        Ui::ChatTabbedWidget *ui;
        ChatWidget *chatWidget;
        qint8 tabsCount;
        IcyBuddies *buddies;
        IcySettings *settings;

        _fastcall qint32 getIndex(const QString &sSN, const bool bAbs);
        _fastcall qint32 getIndex(const qint32 iIndex);

private slots:
    void on_tabWidget_tabCloseRequested(int index);
};

#endif // CHATTABBEDWIDGET_H
